package com.yanfan.energy.domain.enums;

/**
 * 用户状态
 *
 * @author ruoyi
 */
public enum TaskEventTypeEnums {
    //    Other(0L, "其他"),
    WORK_ORDER(1L, "工单"), ORDER_FORM(2L, "订单"), BATCH(3L, "批次"), SEGMENT(4L, "分段");
//    SCHEDULE(5L, "排程");

    private final Long code;
    private final String desc;

    TaskEventTypeEnums(Long code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getEnumByType(Long type) {
        for (TaskEventTypeEnums item : TaskEventTypeEnums.values()) {
            if (item.getCode().equals(type)) {
                return item.getDesc();
            }
        }

        return "";
    }

    public static Boolean enumTypeExist(Long type) {
        for (TaskEventTypeEnums item : TaskEventTypeEnums.values()) {
            if (item.getCode().equals(type)) {
                return true;
            }
        }

        return false;
    }

    public Long getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
